<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script>
//	var arr=new Array(1,2,3,4);
//	for(var i=0;i<arr.length;i++){
//		alert(arr[i])
//	}
	
//用构造方法模拟数组对象
function myArray(){
	var leng=arguments.length;
	for(var i=0;i<leng;i++){
		this[i]=arguments[i]	
	};	
	this.length=leng;
	
};	
	
	myArray.prototype.maxvalue=function(){
		if(typeof this!=='object'){
			return;	
		};
		var temp=this[0];		
		for(var i=0;i<this.length;i++){
			if(temp>this[i]){
				continue;	
			}else{
				temp=this[i];	
			}	
		};
		return temp;
	};
	
	
	
var arr=new myArray(1,2,3,5,4);
//alert(arr[0])	
alert(arr.maxvalue());
//for(var i=0;i<arr.length;i++){
//	alert(arr[i])	
//};	
	
	
	
	
</script>
</body>
</html>
